﻿using System;
using System.Data;
using System.Web;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;
using System.Reflection;
using log4net;

namespace AnyOffice.module.user_select
{
    public partial class dept :  BasePage
    {

        private static ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
       
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                this.ViewState["ToId"] = (Request.QueryString["ToId"] != null) ? Request.QueryString["ToId"].ToString() : "ToId";
                this.ViewState["ToName"] = (Request.QueryString["ToName"] != null) ? Request.QueryString["ToName"].ToString() : "ToName";
                try
                {
                    this.RepeaterUserPriv.DataSource = new UserPrivDao().SelectAll(base.Conn);
                    this.RepeaterUserPriv.DataBind();
                }
                catch (Exception exception)
                {
                    if (log.IsErrorEnabled)
                    {
                        log.Error("", exception);
                    }
                }
                try
                {
                    DataTable table = new GroupDao().SelectAll(base.Conn, base.User.Identity.Name);
                    if (table.Rows.Count > 0)
                    {
                        this.rptGroup.DataSource = table;
                        this.rptGroup.DataBind();
                    }
                    else
                    {
                        this.pnlGroup.Visible = true;
                    }
                }
                catch (Exception exception2)
                {
                    if (log.IsErrorEnabled)
                    {
                        log.Error("", exception2);
                    }
                }
            }
        }

 

 

    }
}
